<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="com.tangdi.Bean.*"%>
<%@ page language="java" import="com.tangdi.Utils"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script language="javascript" type="text/javascript"
	src="My97DatePicker/WdatePicker.js"></script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>个人工资信息查询</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
		function check(){
			var form = document.getElementById('searchPerson_GZ');
			var year_month = form.year_month.value;
			var person_Name = form.person_Name.value;
			var person_Idno = form.person_Idno.value;
			var person_Bank = form.person_Bank.value;
			if(year_month !="" && (person_Name != "" || person_Idno != "" || person_Bank != "")){
			   form.action="searchPersonGZAction";
			   }
			else{
			     alert("年月不能为空，姓名、身份证号、银行卡至少填一项");
			     return;
			     }
			}
	</script>
</head>
<jsp:include page="header.jsp"></jsp:include>
<body>
	<form onSubmit="return check()" method="post" id="searchPerson_GZ">
		<table>
			<tr>
				<td width="70" style="text-align:right">姓名：</td>
				<td width="70"><input type="text" name="person_Name"
					value="${person_Name}" /></td>
				<td width="70"></td>
				<td width="80">身份证号：</td>
				<td width="70"><input type="text" name="person_Idno"
					value="${person_Idno}" /></td>
				<td></td>
				<td><span style="color: red">注意：年月必填，姓名、身份证号、银行卡号至少填一项</span></td>
			</tr>
			<tr>
				<td width="80">银行卡号：</td>
				<td width="70"><input type="text" name="person_Bank"
					value="${person_Bank}" /></td>
				<td width="70"></td>
				<td width="70">年月：</td>
				<td width="70"><input class="Wdate" type="text" required="true" 
					name="year_month" onfocus="WdatePicker({dateFmt:'yyyyMM'})"
					value="${year_month}" /></td>
				<td width="70"></td>
				<td><input type="submit" value="查 询" /></td>
			</tr>
		</table>
	</form>

	<% 
    List<CZGZ_ZGGZMX> person_GZMX_List=new ArrayList<CZGZ_ZGGZMX>();
    Map<String,List<XM_BM_XM_MC>> map_bm_mc_list = new HashMap<String,List<XM_BM_XM_MC>>();
    %>
	<% person_GZMX_List =  (List<CZGZ_ZGGZMX>)session.getAttribute("person_GZMX_List");%>
	<% map_bm_mc_list = (Map<String,List<XM_BM_XM_MC>>)session.getAttribute("map_bm_mc_list");%>
	<% 
	String tr_style = "";
    if(person_GZMX_List !=null && person_GZMX_List.size() > 0){
	    for(int j = 0; j < person_GZMX_List.size(); j++){
	
			CZGZ_ZGGZMX gz_mx = person_GZMX_List.get(j);
			//列名称 --start
			List<XM_BM_XM_MC> bm_mc_list = new ArrayList<XM_BM_XM_MC>();
			bm_mc_list = map_bm_mc_list.get(gz_mx.getGZ_LB_DM());
			if(j % 2 == 0){
				tr_style = "evenrowcolor";
			}else{
				tr_style = "oddrowcolor";
			}
			%>
<div class="<%=tr_style%>">
	<h4>
		单位代码：<%= gz_mx.getDW_DM()%>
		单位名称：<%= gz_mx.getDW_MC()%>
		&nbsp;&nbsp;&nbsp;&nbsp; 姓名：<%= gz_mx.getNME()%>
		&nbsp;&nbsp;&nbsp;&nbsp; 身份号码：<%= gz_mx.getID_NO()%>
		&nbsp;&nbsp;&nbsp;&nbsp; 卡账号：<%= gz_mx.getPER_AC()%>
	</h4>
	<table border="1" cellpadding="0" cellspacing="0" id="caseListTable">
		<tr>
			<% 
			for(int h = 0; h < bm_mc_list.size(); h++){//显示工资科目名称
				String XM_MC = bm_mc_list.get(h).getXM_MC();
			%>
			<td><div align="center"><%= XM_MC%></div></td>
			<% 
			}
			//列名称 --end
			%>
		</tr>

		<tr>
			<% 
	        //列值 --start
			for(int k = 0; k < bm_mc_list.size(); k++){//根据工资类别反射查找工资科目 显示工资科目金额
				String gz_value = (String)Utils.getFieldReflect(gz_mx,CZGZ_ZGGZMX.class,bm_mc_list.get(k).getXM_BM());
				%>
			<td><div align="center"><%= gz_value%></div></td>
			<% 
				}
			%>
		</tr>

	</table>
</div>
<!-- 	<hr></hr> -->
	<% 
			//列值 --end
		}
    }else{%>
	<p>未查到信息</p>
	<% }
   	%>
</body>
</html>
